package com.zf.shuashua.advert;

import com.vise.xsnow.http.callback.ACallback;
import com.zf.shuashua.api.HttpData;
import com.zf.shuashua.bean.AdvertReport;
import com.zf.shuashua.bean.BaseData;

/**
 * 穿山甲/优量汇 广告数据上报
 */
public class AdReportManager {

    private static AdReportManager instance;

    private AdReportManager() {

    }

    public static AdReportManager getInstance() {
        if (null == instance) {
            synchronized (AdReportManager.class) {
                if (null == instance) {
                    instance = new AdReportManager();
                }
            }
        }
        return instance;
    }

    /**
     * @param eventType  执行事件, video_start;video_pause;video_end; video_stop, image_show; video_click; image_click
     * @param type       广告位，1-17
     * @return
     */
    public void reportAdvertAction(String plan_id, String uuid, AdvertReport.EventType eventType, String type, ACallback<BaseData> callback){
        HttpData.getInstance().reportAdAction(plan_id, uuid, eventType, type, "1", callback);
    }

    /**
     * @param eventType  执行事件, video_start;video_pause;video_end; video_stop, image_show; video_click; image_click
     * @param type       广告位，1-17
     * @return
     */
    public void reportAdvertAction(String plan_id, String uuid, AdvertReport.EventType eventType, String type){
        HttpData.getInstance().reportAdAction(plan_id, uuid, eventType, type, "1", new ACallback<BaseData>() {
            @Override
            public void onSuccess(BaseData data) {

            }

            @Override
            public void onFail(int errCode, String errMsg) {
            }
        });
    }

    /**
     * @param eventType  执行事件, video_start;video_pause;video_end; video_stop, image_show; video_click; image_click
     * @param type       广告位，1-17
     * @param way        广告渠道，1穿山甲，2优量汇
     * @return
     */
    public void reportAdvertAction(String plan_id, String uuid, AdvertReport.EventType eventType, String type, String way, ACallback<BaseData> callback){
        HttpData.getInstance().reportAdAction(plan_id, uuid, eventType, type, way, callback);
    }

    /**
     * @param eventType  执行事件, video_start;video_pause;video_end; video_stop, image_show; video_click; image_click
     * @param type       广告位，1-17
     * @param way        广告渠道，1穿山甲，2优量汇 3、 4、 5、芒果 6、小米 7、google、 8、adMobile
     * @return
     */
    public void reportAdvertAction(String plan_id, String uuid, AdvertReport.EventType eventType, String type, String way){
        HttpData.getInstance().reportAdAction(plan_id, uuid, eventType, type, way, new ACallback<BaseData>() {
            @Override
            public void onSuccess(BaseData data) {

            }

            @Override
            public void onFail(int errCode, String errMsg) {
            }
        });
    }

}
